import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { increment } from './store/actions/calc'

export default function App() {
  const count = useSelector((state) => state.calc)
  const dispatch = useDispatch()
  const handleClick = () => {
    /* setTimeout(() => {
      dispatch(increment(3))
    }, 1000) */
    dispatch(increment(3))
  }
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={handleClick}>+1</button>
    </div>
  )
}
